<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <div>父组件：{{ money }}</div>
  <hr />
  <!-- $event 是触发自定义事件传递的数据，父组件收到值后把money修改一下 -->
  <ChildCom :money="money" @change-money="money=$event" />
</template>

<script>
import { ref } from "vue";
import ChildCom from "./ChildCom.vue";
export default {
  name: "App",
  components: { ChildCom },
  setup() {
    // 父组件数据
    const money = ref(10000);
    return { money };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
